InstituArchRevForm=Ext.extend(Ext.Window,{
    constructor:function(a){
        Ext.apply(this,a);
        console.info(this.operation)
        this.initUIComponents();
        InstituArchRevForm.superclass.constructor.call(this,{
            layout:'fit',
            id : 'InstituArchRevForm',
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "制度档案修订信息添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 375
        });
    },
    initUIComponents:function(a){
        var getUrl="";
      
        if(this.operation=="修改"){
            getUrl="/securitysystem/getInstituArchRev.do"
        }else if(this.operation=="查询"){
            getUrl="/securitysystem/getListInstituArchRev.do"
        }
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/securitysystem/saveInstituArchRev.do",
                items:[
                        {
                            id : "instituArchRev.id",
                            name : "instituArchRev.id",
                            xtype : "hidden",
                            value : this.id == null ? "": this.id
                        }, {
                            name : "instituArchRev.years",
                            xtype : "hidden",
                            id : "instituArchRev.years",
                            value : this.years == null ? "" : this.years
                        },/*{
                            name : "instituArchRev.institutionalId",
                            xtype : "textfield",
                        },*/ {
                            layout:'column',
                            bodyStyle:"padding:5px;",
                            border:false,
                            items:[{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                columnWidth:.5,
                                border:false,
                                items:[{
                                    xtype:'combo',
                                    fieldLabel:'所属机构',
                                    hiddenName:'instituArchRev.institution',
                                    mode:'local',
                                    editable:false,
                                    width:146,
                                    triggerAction:'all',
                                    store:new Ext.data.ArrayStore({
                                        id:0,
                                        fields:['id','type'],
                                        data:[ [ "1", "组织部" ],
                                               [ "2", "财务部" ],
                                               [ "3", "销售部" ]]
                                    }),
                                    valueField:'type',
                                    displayField:'type',
                                    value:'销售部'
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                columnWidth:.5,
                                border:false,
                                items:[{
                                    xtype:'textfield',
                                    fieldLabel:'制度编号<font color="red">*</font>',
                                    name:'instituArchRev.instilNo',
                                    width:146,
                                    allowBlank:false,
                                    maxLength:100
                                },{
                                    xtype:'hidden',
                                    name:'instituArchRev.institutionalId',
                                    width:0
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    fieldLabel:'制度名称',
                                    name:'instituArchRev.instiName',
                                    width:146,
                                    maxLength:200
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    name:'instituArchRev.instiVersion',
                                    fieldLabel:'版本号',
                                    width:146,
                                    maxLength:100
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'datefield',
                                    name:'instituArchRev.taskEffiveTime',
                                    fieldLabel:'生效时间',
                                    width:146,
                                    format:'y-m-d',
                                    allowBlank : false,
                                    blankText : "生效时间不能为空！"
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'datefield',
                                    name:'instituArchRev.reviseTime',
                                    fieldLabel:'修订时间',
                                    width:146,
                                    format:'y-m-d',
                                    allowBlank : false,
                                    blankText : "修订时间不能为空！"
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    name:'instituArchRev.revisePeople',
                                    fieldLabel:'修订人',
                                    width:146,
                                    maxLength:100
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    name:'instituArchRev.reviseDept',
                                    fieldLabel:'修订部门',
                                    width:146,
                                    maxLength:100
                                }]
                            }]
                        },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:"textarea", 
                               fieldLabel: '制度描述', 
                               name: 'instituArchRev.instiDescribe', 
                               width : 448,
                               maxLength:2000
                               }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:'form',
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:'textarea',
                               fieldLabel:'备注',
                               name:'instituArchRev.remark',
                               width:448,
                               maxLength:1000
                               }]
                           }]
                       }
               ]
            },
            loadData:{
                getUrl:__ctxPath +getUrl,
                preName : "instituArchRev"
            },
            isShow : this.isShow
        });
    }
});